home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok22.lha
/
Observer
/
Observer1.0.asm
< prev
next >
Wrap
Assembly Source File
|
1993-08-15
|
25KB
|
755 lines
***********************************************************************
*
* :Program. Observer
* :Author. Holger Gzella
* :Address. Freischöffenweg 12 D-4600 Dortmund 16
* :Phone. (0231) 85 16 02
* :Version. v1.0
* :Date. 6/7/89 19:44:07
* :Copyright. PD; SHAREWARE-payment welcome, of course
* :Language. 68000-Assembler
* :Translator. DevPac v2.11
* :Contents. THE VERY END OF ALL BOOTBLOCK-VIRUSES!!!
* :Usage. Observer1.0 or just click it
* :Bugs. a) don't start it twice (meditation)!
* :Bugs. b) doesn't work with one bootblock - my bootintro!!!!!
* :Remark. sorry lack of comments ... enjoy the code!
* :Remark. please leave my name in; I worked hard on this!
*
***********************************************************************
incdir "dh1:Assembler/include/" * individuell
include "exec/resident.i"
include "exec/memory.i"
include "exec/execbase.i"
include "exec/exec_lib.i"
include "intuition/intuition_lib.i"
include "misc/easystart.i" * für WB-Start
*
* Startup-Programm - prüft, ob schon was über KickTag installiert
* ist - könnte das eigene Programm sein.
*
move.l _SysBase,a6 * ist bereits
move.l KickTagPtr(a6),a0 * was im KickTagPtr
cmp.l #$0,a0 * abgelegt (1.3 RAD:
bne InsYet * z.B.)?
lea IntName,a1
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l d0,a6
lea InstallAlert,a0 * Sicherheits-
moveq.l #0,d0 * abfrage
move.l #80,d1
jsr _LVODisplayAlert(a6)
move.l d0,d4
move.l a6,a1
CALLEXEC CloseLibrary
tst.l d4
bne InstallStuff
moveq.l #0,d0
rts
*
* Ab hier wird der Code von "ResetStuff"-"ResetEnd" eingebunden.
* Der ganze Kram muß im PUBLIC- und CHIP-Memory abgelegt sein.
*
InstallStuff: move.l #MEMF_PUBLIC|MEMF_CLEAR|MEMF_CHIP,d1
move.l #48,d0
CALLEXEC AllocMem * Speicher für
move.l d0,MemListPtr * MemList
move.l d0,a0 * Nodetype und
move.b #NT_MEMORY,8(a0) * Anzahl der Ein-
move.w #4,14(a0) * träge setzen
move.l #MEMF_PUBLIC|MEMF_CHIP,d1
move.l #ResetEnd-ResetStuff,d0
CALLEXEC AllocMem * Speicher für
move.l d0,Code * Code
move.l ResidentPtr,a0 * merken
move.l Code,22(a0)
move.l #MEMF_PUBLIC|MEMF_CHIP,d1
move.l #26,d0
CALLEXEC AllocMem * Speicher für
move.l d0,NewRes * Resident-Modul
lea Resident,a0 * Resident-Modul
move.l #25,d0 * in den neuen
move.l NewRes,a1 * Speicher kopieren
CopyRes: move.b (a0)+,(a1)+
dbra d0,CopyRes
move.l NewRes,a0 * neues Resident-
move.l a0,d0 * Modul patchen
add.b #26,d0
move.l d0,6(a0)
move.l a0,2(a0)
move.l MemListPtr,a0 * MemList patchen
move.l Code,16(a0)
move.l #ResetEnd-ResetStuff,20(a0)
move.l NewRes,24(a0)
move.l #26,28(a0)
move.l #MEMF_PUBLIC|MEMF_CLEAR|MEMF_CHIP,d1
move.l #8,d0
CALLEXEC AllocMem * Speicher für
move.l d0,PtrTable * Tag-Ptr
move.l d0,a0
move.l NewRes,(a0)
move.l MemListPtr,a0 * MemList richtig
move.l d0,32(a0) * setzen
move.l #8,36(a0)
move.l a0,40(a0)
move.l #48,44(a0)
move.l MemListPtr,MemPtr * Zeiger zwischen-
move.l PtrTable,TagPtr * speichern
move.l Code,a1
move.l #ResetEnd-ResetStuff-1,d0
lea ResetStuff,a0
Copy: move.b (a0)+,(a1)+
dbra d0,Copy
move.l _SysBase,a5
move.l MemListPtr,KickMemPtr(a5) * Zeiger
move.l PtrTable,KickTagPtr(a5) * setzen
CALLEXEC SumKickData * Checksumme
move.l d0,KickCheckSum(a5) * eintragen
move.w #$ffff,d0 * Farbspiel,
Blink: move.w d0,$dff180 * um anzuzei-
dbra d0,Blink * gen, daß
moveq #0,d0 * Observer
rts * installiert ist
*
* Dieser Teil wird aufgerufen, wenn das Programm den KickTagPtr nicht
* unbenutzt auffindet. Es könnte das eigene Programm oder z.B. die
* resetfeste RAM-Disk der WB1.3 (RAD:) installiert sein. Diese wird
* bei der Installation von Observer gelöscht. Schade 'drum.
*
InsYet: lea IntName,a1
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l d0,a6
lea YetAlert,a0
moveq.l #0,d0
move.l #50,d1
jsr _LVODisplayAlert(a6)
bne EndYet
move.l _SysBase,a1
clr.l KickMemPtr(a1) * alle drei
clr.l KickTagPtr(a1) * Kick-Zeiger
clr.l KickCheckSum(a1) * löschen
EndYet: move.l a6,a1
CALLEXEC CloseLibrary
moveq #0,d0
rts
*
* Hier stehen diverse Daten für den Installationsteil.
*
YetAlert: dc.b 0,168,10,"OBSERVER v1.0 ist bereits installiert!",0,$93
dc.b 0,184,20,"Soll das Programm entfernt werden?",0,$ea
dc.b 0,164,40,"= LINKS: NEIN = = RECHTS: JA =",0,0
InstallAlert: dc.b 0,172,10,"*** OBSERVER v1.0 by Holger Gzella ***",0,$93
dc.b 0,172,20," Der ultimative Virus-Protektor",0,$ea
dc.b 0,112,40,"ACHTUNG: Durch die Installation geht der Inhalt evtl.",0,$eb
dc.b 0,152,50,"vorhandener resetfester RAM-DISKs verloren!",0,$ec
dc.b 0,104,70,"= LINKS: Installieren = = RECHTS: Abbrechen =",0,0
dc.b "©1989 HG"
*
* Dieser Code wird resetfest gemacht und vor jedem Bootvorgang
* aufgerufen.
*
ResetStuff: movem.l d0-d6/a0-a6,-(SP)
lea OldIO(pc),a0 * alten DoIO-Vektor
move.l -454(a6),(a0) * zwischenspeichern
lea SpecialFlag(pc),a0 * Flag für Spezial-
move.b #$00,(a0) * Optionen löschen
btst.b #6,$bfe001 * Maustaste?
bne ClearDosFlag * nein...weiter
move.b #$ff,(a0) * S.-O. gewählt
move.w #$f50,$dff180 * anzeigen
ClearDosFlag: lea DosFlag(pc),a0 * Bootblock-Flag
move.b #$00,(a0) * löschen
move.l #$50000,a0 * benutztes RAM
move.w #5000,d0 * löschen
Clear: move.l #0,(a0)+
dbra d0,Clear
*
* Das hier entspricht teilweise der Original-KickStart-Bootroutine,
* die aber nach Installation dieses Programms nicht mehr zum Zuge
* kommt.
*
moveq #0,d3
sub.l a4,a4
link a5,#-126
sub.l #$7e,a5
move.l a6,0(a5)
move.l d3,4(a5)
move.l #$50000,a4
lea IOName(pc),a0
move.l a0,54(a5)
move.l a0,102(a5)
sub.l a1,a1
CALLEXEC FindTask
move.l d0,108(a5)
move.b #0,106(a5)
lea 112(a5),a0
move.l a0,(a0)
addq.l #4,(a0)
clr.l 4(a0)
move.l a0,8(a0)
moveq #$ff,d0
CALLEXEC AllocSignal
move.b d0,107(a5)
lea 92(a5),a0
move.l a0,58(a5)
lea TrackName(pc),a0
lea 44(a5),a1
moveq #0,d0
moveq #0,d1
CALLEXEC OpenDevice
move.w #$100,$dff096
lea 44(a5),a1
move.w #$5,28(a1)
CALLEXEC DoIO
lea 44(a5),a1
move.w #$0d,28(a1)
CALLEXEC DoIO
move.l 76(a5),d2
lea 44(a5),a1
move.w #$2,28(a1)
move.l #$400,36(a1)
move.l a4,40(a1)
move.l #$0,44(a1)
CALLEXEC DoIO
move.l 4(a4),d0
cmp.l #$c0200f19,d0
beq ItsDos
cmp.l #$0,d0
beq ItsNothing
lea DosFlag(pc),a0
move.b #$ff,(a0)
bra ItsDos
ItsNothing: lea DosFlag(pc),a0
move.b #$01,(a0)
move.l #9,28(a1)
move.l #0,36(a1)
CALLEXEC DoIO
move.w #$8100,$dff096
CALLEXEC CloseDevice
ItsDos: move.l _SysBase,a6
move.l MemPtr(pc),a0
move.l a0,KickMemPtr(a6)
move.l TagPtr(pc),a0
move.l a0,KickTagPtr(a6)
CALLEXEC SumKickData
move.l d0,KickCheckSum(a6)
ExecuteIt: lea IntName(pc),a1
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l a6,a2
move.l d0,a6
move.l a6,a3
moveq.l #0,d0
add.l CoolCapture(a2),d0
add.l ColdCapture(a2),d0
add.l WarmCapture(a2),d0
cmp.l #0,d0
beq BootStuff
lea CaptureAlert(pc),a0
moveq.l #0,d0
move.l #60,d1
jsr _LVODisplayAlert(a6)
bne BootStuff
clr.l CoolCapture(a2)
clr.l ColdCapture(a2)
clr.l WarmCapture(a2)
BootStuff: lea SpecialFlag(pc),a0
cmp.b #$ff,(a0)
bne CheckNormal
lea AskParams(pc),a0
moveq.l #0,d0
move.l #60,d1
jsr _LVODisplayAlert(a6)
beq AskForFast
move.l a6,d6
CALLEXEC GetCC
lea ret3(pc),a0
move.l d0,(a0)
move.w #15,d0
lea ret00(pc),a0
FetchRegs: move.l (SP)+,(a0)+
dbra d0,FetchRegs
move.w #15,d0
SetRegs: move.l -(a0),-(SP)
dbra d0,SetRegs
lea ZwischenD1(pc),a1
lea ret00(pc),a0
moveq.w #3,d4
jsr ConvHex(pc)
lea ZwischenD2(pc),a1
lea ret01(pc),a0
moveq.w #3,d4
jsr ConvHex(pc)
lea ZwischenA1(pc),a1
lea ret10(pc),a0
moveq.w #3,d4
jsr ConvHex(pc)
lea ZwischenA2(pc),a1
lea ret11(pc),a0
moveq.w #2,d4
jsr ConvHex(pc)
lea ZwischenS(pc),a1
lea ret2(pc),a0
moveq.w #0,d4
jsr ConvHex(pc)
lea ZwischenC(pc),a1
lea ret3(pc),a0
moveq.w #0,d4
jsr ConvHex(pc)
lea ZwischenCool(pc),a1
move.l CoolCapture(a6),a0
moveq.w #0,d4
jsr ConvHex(pc)
lea ZwischenCold(pc),a1
move.l ColdCapture(a6),a0
moveq.w #0,d4
jsr ConvHex(pc)
lea ZwischenWarm(pc),a1
move.l WarmCapture(a6),a0
moveq.w #0,d4
jsr ConvHex(pc)
lea ZwischenIO(pc),a1
move.l OldIO(pc),a0
moveq.w #0,d4
jsr ConvHex(pc)
move.l d6,a6
lea ParamAlert(pc),a0
moveq.l #0,d0
move.l #220,d1
jsr _LVODisplayAlert(a6)
AskForFast: lea AskNoFast(pc),a0
moveq.l #0,d0
move.l #60,d1
jsr _LVODisplayAlert(a6)
beq AskForIO
move.l a6,d6
move.l #$20004,d1
CALLEXEC AvailMem
move.l #$20004,d1
CALLEXEC AllocMem
move.l d6,a6
AskForIO: lea AskDoIO(pc),a0
moveq.l #0,d0
move.l #60,d1
jsr _LVODisplayAlert(a6)
beq CheckNormal
move.l a6,d6
move.l $4,a1
lea NewIO(pc),a0
move.l a0,d0
move.l #_LVODoIO,a0
CALLEXEC SetFunction
move.l d6,a6
CheckNormal: lea DosFlag(pc),a0
cmp.b #$00,(a0)
beq Normal
cmp.b #$01,(a0)
beq KickOrSo
lea NoDosAlert(pc),a0
moveq.l #0,d0
move.l #60,d1
jsr _LVODisplayAlert(a6)
bne Weiter
movem.l d0-d4/a0/a2-a6,-(SP)
move.l a4,a3
move.l #$51000,a4
zeigmal: moveq.w #0,d4
lea ShowAlert(pc),a0
nächster: move.b (a0)+,0(a4,d4.w)
add.w #1,d4
cmp.b #200,-1(a4,d4.w)
bne nächster
move.w #1,d3
zeile: bsr zeilenanfang
move.w #59,d2
zeichen: move.b (a3)+,d1
cmp.b #$20,d1
blt kleiner
cmp.b #127,d1
blt ok
kleiner: move.b #46,d1
ok: move.b d1,0(a4,d4.w)
add.w #1,d4
dbra.w d2,zeichen
move.b #0,0(a4,d4.w)
move.b #200,1(a4,d4.w)
add.w #2,d4
add.w #1,d3
gof: cmp.w #18,d3
bne zeile
endal: bsr zeilenanfang
moveq.w #0,d0
move.l #15,d2
move.b #0,0(a4,d4.w)
move.b #0,1(a4,d4.w)
move.l a4,a1
movem.l (SP)+,d0-d4/a0/a2-a6
move.l a1,a0
move.l a1,d6
moveq.l #0,d0
move.l #200,d1
jsr _LVODisplayAlert(a6)
beq ClearIt
Weiter: lea WeiterAlert(pc),a0
moveq.l #0,d0
move.l #40,d1
jsr _LVODisplayAlert(a6)
move.l a6,a3
tst.l d0
beq Special
Normal: move.l _SysBase,a6
lea 44(a5),a1
movem.l d0-d6/a1-a7,-(SP)
jsr 12(a4)
movem.l (SP)+,d0-d6/a1-a7
move.l a0,d6
bra Return
KickOrSo: lea KickAlert(pc),a0
moveq.l #0,d0
move.l #30,d1
jsr _LVODisplayAlert(a6)
moveq #0,d0
move.b 15(a5),d0
CALLEXEC FreeSignal
add.l #$7e,a5
unlk a5
move.l a3,a0
movem.l (SP)+,d0-d6/a1-a6
bra ResetStuff
Special: lea ResName(pc),a1
CALLEXEC FindResident
move.l d0,a0
move.l 22(a0),d6
Return: move.l a3,a1
CALLEXEC CloseLibrary
move.w #$8100,$dff096
lea 44(a5),a1
CALLEXEC CloseDevice
moveq #0,d0
move.b 15(a5),d0
CALLEXEC FreeSignal
add.l #$7e,a5
unlk a5
move.l d6,a0
movem.l (SP)+,d0-d6/a1-a6
jmp (a0)
ClearIt: lea ClearAlert(pc),a0
moveq.l #0,d0
move.l #40,d1
jsr _LVODisplayAlert(a6)
bne Weiter
move.l a6,d5
move.l #$52000,a2
lea Block(pc),a1
move.w #13,d0
CopyBlock: move.l (a1)+,(a2)+
dbra d0,CopyBlock
lea 44(a5),a1
move.w #$3,28(a1)
move.l #1024,36(a1)
move.l #$0,44(a1)
move.l #$52000,40(a1)
CALLEXEC DoIO
move.w #$4,28(a1)
CALLEXEC DoIO
move.l d5,a3
bra Special
even
NewIO: movem.l d0-d7/a0-a6,-(SP)
move.l 20(a1),a0
move.l 10(a0),a0
lea TrackName(pc),a2
moveq #8,d0
CheckForTD: cmpm.b (a0)+,(a2)+
bne GoHome
dbra d0,CheckForTD
bra CheckForBB
GoHome: movem.l (SP)+,d0-d7/a0-a6
bra JumpIO
CheckForBB: movem.l (SP)+,d0-d7/a0-a6
cmp.w #$03,28(a1)
bne JumpIO
tst.l 44(a1)
bne JumpIO
movem.l d0-d3/a0-a6,-(SP)
move.l a1,a5
move.l 40(a1),a3
lea IntName(pc),a1
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l d0,a6
lea BBTryAlert(pc),a0
moveq.l #0,d0
move.l #60,d1
jsr _LVODisplayAlert(a6)
bne LetItBe
move.l #$ff,d6
LetItBe: move.l a6,a1
CALLEXEC CloseLibrary
movem.l (SP)+,d0-d3/a0-a6
cmp #$ff,d6
bne JumpIntoDoom
move.l #15,28(a1)
JumpIntoDoom: bra JumpIO
BBTryAlert: dc.b 0,130,10,"*** OBSERVER v1.0 by Holger Gzella ***",0,$93
dc.b 0,110,30,"Schreib-Zugriffsversuch auf den Bootblock!",0,$ea
dc.b 0,70,50,"= LINKS: Weiter = = RECHTS: Verhindern =",0,0
ResName: dc.b "dos.library",0
even
IntName: dc.b "intuition.library",0
even
TrackName: dc.b "trackdisk.device",0
even
IOName: dc.b "Strap",0
even
JumpIO: dc.w $4ef9
OldIO: dc.l 0
MemPtr: dc.l 0
TagPtr: dc.l 0
DosFlag: dc.b 0
SpecialFlag: dc.b 0
ret00: ds.l 4
ret01: ds.l 4
ret10: ds.l 4
ret11: ds.l 3
ret2: ds.l 1
ret3: ds.l 1
zeilenanfang: move.b #0,0(a4,d4.w)
move.b #20,1(a4,d4.w)
move.w d3,d1
mulu #10,d1
add.l #20,d1
move.b d1,2(a4,d4.w)
add.w #3,d4
rts
roll: ror.w #4,d1
bsr conv
moveq.b #0,d1
rol.w #4,d1
bsr conv
rts
conv: add.b #$30,d1
cmp.b #$3a,d1
blt small
add.b #$7,d1
small: move.b d1,0(a4,d4.w)
add.w #1,d4
rts
NoDosAlert: dc.b 0,130,10,"*** OBSERVER v1.0 by Holger Gzella ***",0,$93
dc.b 0,155,30,"ACHTUNG: Kein Standard-Bootblock!",0,$ea
dc.b 0,90,50,"= LINKS: Weiter = = RECHTS: Ansehen =",0,0
WeiterAlert: dc.b 0,140,10,"Soll der Bootblock ausgeführt werden?",0,$93
dc.b 0,50,30,"= LINKS: Ausführen = = RECHTS: Überspringen =",0,0
KickAlert: dc.b 0,120,10,"Die Diskette in DF0: ist nicht bootfähig!",0,$93
dc.b 0,70,20,"Bitte Diskette wechseln und eine Maustaste drücken!",0,0
ShowAlert: dc.b 0,75,10,"= LINKS: Ausführen = = RECHTS: Löschen =",0,200
ClearAlert: dc.b 0,125,10,"Soll der Bootblock überschrieben werden?",0,$93
dc.b 0,60,30,"= LINKS: Weiter = = RECHTS: Überschreiben =",0,0
CaptureAlert: dc.b 0,220,10,"*** W A R N U N G ***",0,$93
dc.b 0,140,30,"Die Capture-Vektoren sind verändert!!",0,$ea
dc.b 0,65,50,"= LINKS: Weiter = = RECHTS: Zurücksetzen =",0,0
AskParams: dc.b 0,140,10,"*** OBSERVER v1.0 -- Spezialmenü ***",0,$93
dc.b 0,100,30,"Sollen die Systemparameter angezeigt werden?",0,$ea
dc.b 0,125,50,"= LINKS: JA = = RECHTS: NEIN =",0,0
AskNoFast: dc.b 0,140,10,"*** OBSERVER v1.0 -- Spezialmenü ***",0,$93
dc.b 0,115,30,"Soll das Fast-Memory ausgeschaltet werden?",0,$ea
dc.b 0,125,50,"= LINKS: JA = = RECHTS: NEIN =",0,0
AskDoIO: dc.b 0,140,10,"*** OBSERVER v1.0 -- Spezialmenü ***",0,$93
dc.b 0,130,30,"Soll die DoIO-Routine verändert werden?",0,$ea
dc.b 0,125,50,"= LINKS: JA = = RECHTS: NEIN =",0,0
ParamAlert: dc.b 0,205,10,"*** SYSTEMPARAMETER ***",0,$ff
dc.b 0,20,30,"Datenregister D0-D3:",0,$ff,0,20,40
ZwischenD1: ds.b 36
dc.b 0,$ff
dc.b 0,20,50,"Datenregister D4-A7:",0,$ff,0,20,60
ZwischenD2: ds.b 36
dc.b 0,$ff
dc.b 0,20,80,"Adressregister A0-A3:",0,$ff,0,20,90
ZwischenA1: ds.b 36
dc.b 0,$ff
dc.b 0,20,100,"Adressregister A4-A6:",0,$ff,0,20,110
ZwischenA2: ds.b 27
dc.b 0,$ff
dc.b 0,20,130,"Benutzer-Stack: "
ZwischenS: ds.b 9
dc.b " Condition-Codes: "
ZwischenC: ds.b 9
dc.b 0,$ff
dc.b 0,20,150,"CoolCapture-Vektor: "
ZwischenCool: ds.b 9
dc.b 0,$ff
dc.b 0,20,160,"ColdCapture-Vektor: "
ZwischenCold: ds.b 9
dc.b 0,$ff
dc.b 0,20,170,"WarmCapture-Vektor: "
ZwischenWarm: ds.b 9
dc.b 0,$ff
dc.b 0,20,190,"DoIO-Vektor: "
ZwischenIO: ds.b 9
dc.b 0,$ff
dc.b 0,200,210,"= LINKS/RECHTS: WEITER =",0,0
Block: dc.l $444f5300,$c0200f19,$00000370,$43fa0018,$4eaeffa0
dc.l $4a80670a,$20402068,$00167000,$4e7570ff,$60fa646f
dc.l $732e6c69,$62726172,$79000000
ConvHex: moveq.w #7,d3
move.l (a0)+,d1
ConvLoop1: rol.l #4,d1
move.w d1,d2
and.w #$0f,d2
add.w #$30,d2
cmp.w #$3a,d2
bcs ConvLoop2
addq.w #7,d2
ConvLoop2: move.b d2,(a1)+
dbra d3,ConvLoop1
move.b #$20,(a1)+
dbra d4,ConvHex
rts
ResetEnd:
Resident: dc.w RTC_MATCHWORD
dc.l 0,0
dc.b 1,0,0,-1
dc.l 0,0,0
ResidentPtr: dc.l Resident
Code: dc.l 0
NewRes: dc.l 0
PtrTable: dc.l 0
MemListPtr: dc.l 0
END